# 1.属性装饰器
class Animal(object):
    def __init__(self):
        self.__name = 'Animal'
        self.__age = 1
        self.__sex = 'male'
        self.__weight = 10
        self.__height = 100


    # __name 的属性装饰器
    @property
    def name(self):
        return self.__name

    @name.setter
    def name(self, value):
        self.__name = value
    
    
    @property
    def age(self):
        return self.__age
    
    @age.setter
    def age(self, value):
        self.__age = value

    def show(self):
        print('name: ', self.name, 'age: ', self.age)


# 创建一个对象
a = Animal()
a.name = 'Animal'
a.age = 1
a.show()
print(a.name)
print(a.age)